package com.woniuxy.utils;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

	// ↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016101900721277";

	// 商户私钥，您的PKCS8格式RSA2私钥
	public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCMLz6dlJJlP0ZHhPTCXKP5K2cixOYYLtQx6L1AJea/C6Fg+K+SaMNbGEcDa4WMuQM/9vtxr2Nr5QP6phTp2cU55ZtRijqqa7Y46A1LMjvklRmCXe/qllRtg5SKrtczimETEOMhc/802U3Fbg7wBSxdbO8w+EgTKJYcb/lZfMeRlZmSnE+3jQ1ZjmhC6rKm5xOHTuLkw9LlSmGpHbjonx7c/EzDxs3sMnDg1WvaMwWsxnHDTlw3gf3Uy1xf78CRUz5Li/GYVOxj3PeHzoteHAEyF5EHaVTWu1798dBMlffAD/wkXiYuR4tqufz1X05VNXDPhiEXTNo/qV7fCUDNWu/hAgMBAAECggEAUAzqhLHCp25qg4y4+ARO3oqaapBllImpQpbU+zypd478qJNaLxED/ZDvfFR5/tHnuS8ghtrQu1wb2ZXde2yP42/qMbXtqkO32ucoMDiPWwiJeJiL2DngHGl2+Xq+CQCMTobmLMRAh71PW95tSUKrAu6h6CTfg5E5pyOKED/g9pDKWT04DlDJ05yZUPFya08ttx/LjoEWTpI3m5FYiW5eRoWoYbbNpHh1NCcztbmn0+dy2JvvFTRGpl+8fhzYQIxtWTzghu0/V+KxpX6XtmW1cFFTKDd6sF6fppgw0ZBusq4aYXroXBjBCReu07ogNjrhPAKsf55z+5fJ72R3nTCMwQKBgQDnf4u39aKqfwcZ4hCrZaaH3G3Hmt0wxJYZnK2FmUGUa3QJ14SFzheNWhMkO13+qgCJUYbEqGW5I6whw1d4ZcxeF06yqaRtSXlYajjOYwEut2tpO9zMpzwlWJ5QkqSEJ5vFbPQcsVcnaHwFddixFsTBsV6vmLWYB95yuLSQ4/PnTwKBgQCbBY0G4NQ4y5l+4X1Nbv2cXrhfmJ4JOwXjQv3oe6URQCTjwwCd9SErrRcoctoUKU3L/Mmeck1wZf8kFHyMQ8rbkYdiliks30XlU1KOUlpUroE6Vgm4nhXvg3P0VOnl1qSAKMRDxrMefxApxDK/78fBBSxPcLm11hWHTG4IAaTpzwKBgBoPv9j77E4pctE1JA9HqFHPPQSlqJUe7I8Bln9d24Yr+qpI+wBdTUV6iIEhtdk/pkPPS87D7n/DRlOevDAvtaw6D4AJnRs4lFKh0rdZaf6qY4s7VAYuJZVGvrvvZloCY4T8WRcJ1/f1yVCMDdMR7yCnKTO3i2oMKLzdkmZlY0X9AoGATK3tOSbCsqk67sDYuxGYjt1nc5nJKiWw3t4HPBTU7Hh/Bs4xIvDajIEcwFw3NNvNaIZMsHw3g85f6tfbV4I8+Gi+v+wox9JU/388ibuAhPygXVuriU9g6E1scMIDxDVsvxvrIN9LQF13gEFVHQ2dEAPgDBdlNOWFVpxenMU7bo8CgYEAykc27kmYWs3aGPzCv6KxCRrhIpuWbyuKYbgNXU2Mz/kH/eCXRqG8/DKRhYsVYGoJPFkWsS1LTb9cPKlCK94bO7Ge39+nuvkbuUSeRTz5j0GlqaTefIz4TM1x7L+3C57L5FIa8rUP0Nwf2QquGISXktszqTPbxo4qJ3z95+Y6vWQ=";
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
	public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqnc8lWqNbgqDtTDpQAIMjQGNtkkIxlaB8WeMBZMc+Y3hIDhe+ony/TwErU8cTF3uoGO0ijmxF8lkoVTit8WpwmS37/9tsOppVTTamJF7fUSwgWNoafQ/7109KYeTLQoeidI12KU+JXcP6JHLn61FFVzmD2MzRKO6p16l2PERhMSG4GkmHn2K5tNr5EJcvsRF9piDIzrjwqr/hSL/GPxsxiYuxFJycZQ+84FI18phin9lbe6GoSS8nMkQLHnN+kMflt7eYZNx+z4QZVXEbcsqAh/KqFlIsPj0KS9c8Ke5DFLGJraXH01DWcm+/hriKRydOH9ghmmLpC8OOx0MVq0C7QIDAQAB";
	// 服务器异步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://32402dm860.wicp.vip/alipay/notify";
	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://32402dm860.wicp.vip/alipay/return";

	// 签名方式
	public static String sign_type = "RSA2";

	// 字符编码格式
	public static String charset = "utf-8";

	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

	// 支付宝网关
	public static String log_path = "E:\\";

	// ↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

	/**
	 * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
	 * 
	 * @param sWord
	 *            要写入日志里的文本内容
	 */
	public static void logResult(String sWord) {
		FileWriter writer = null;
		try {
			writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
			writer.write(sWord);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (writer != null) {
				try {
					writer.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}
}
